Skip to content

Fix VS Code reconnect credential option#73

Merged
mkrueger merged 2 commits intomainfrom
fix/vscode-reconnect-credential
May 5, 2026
Merged

Fix VS Code reconnect credential option#73
mkrueger merged 2 commits intomainfrom
fix/vscode-reconnect-credential

Conversation

@mkrueger
Copy link
Copy Markdown
Contributor

@mkrueger mkrueger commented May 5, 2026

Summary

  • Accept the hidden -vscode-credential / --connect-vscode-credential option on the interactive connect command.
  • Route the option to the existing VisualStudioCodeCredential reconnect path.
  • Keep hidden options out of public help/completion/MCP surfaces while still recognizing them for shell highlighting and LSP diagnostics.

Fixes AzureCosmosDB/cosmosdb-shell-preview#24

Validation

  • dotnet test .\CosmosDBShell.Tests\CosmosDBShell.Tests.csproj --filter "FullyQualifiedName~ConnectCommandTests|FullyQualifiedName~CosmosShellCompletionHandlerTests" -p:BaseOutputPath=.\obj\agent-hidden-test\

@mkrueger mkrueger requested review from a team and Copilot May 5, 2026 07:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables the interactive connect command to accept a previously hidden VS Code reconnect credential flag (e.g. -vscode-credential / --connect-vscode-credential) and routes it to the existing VisualStudioCodeCredential connection path, while ensuring hidden options remain excluded from public help/completion/MCP surfaces but are still recognized by highlighting and LSP diagnostics.

Changes:

  • Add a Hidden flag to CosmosOptionAttribute and introduce CommandFactory.AllOptions to track hidden + public options separately.
  • Update shell option-prefix highlighting and LSP semantic option validation to recognize hidden options via AllOptions.
  • Add hidden VS Code credential flag to connect and add tests validating binding + metadata visibility + LSP diagnostics behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/SemanticAnalyzer.cs Uses AllOptions so hidden options don’t trigger unknown-option diagnostics.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CosmosOptionAttribute.cs Adds Hidden attribute property to mark options excluded from public surfaces.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CommandRunner.cs Uses AllOptions for option-prefix recognition (highlighting/diagnostics friendliness).
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ConnectCommand.cs Adds hidden -vscode-credential/--connect-vscode-credential option and forwards it into ConnectAsync.
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/CommandFactory.cs Builds AllOptions + filtered Options list to keep hidden flags out of public surfaces.
CosmosDBShell.Tests/CommandTests/ConnectCommandTests.cs Adds tests covering hidden option binding, metadata visibility, option-prefix recognition, and semantic diagnostics.

Comment thread CosmosDBShell.Tests/CommandTests/ConnectCommandTests.cs Outdated
@mkrueger mkrueger merged commit 940f31e into main May 5, 2026
7 checks passed
@mkrueger mkrueger deleted the fix/vscode-reconnect-credential branch May 5, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cosmos DB Shell launched from menu stays disconnected after prior disconnect

3 participants